import h5py
import numpy as np
from PIL import Image

img = Image.open('./img/h5.png')
img_array = np.array(img)

patches_y = np.zeros(250)  # 250个0

fileName = 'WriteTest.h5'
filePath = './file/'

with h5py.File(filePath + fileName, 'w') as f:
    f['x'] = img_array
    f['y'] = patches_y

with h5py.File(filePath + fileName, 'r') as f:
    for key in f.keys():
        print(f[key].name)
        print(f[key].shape)
